<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>
<HEAD>
   <TITLE>int pblKEYFILE_TestFrame</TITLE>
   <META NAME="GENERATOR" CONTENT="DOC++ 3.4.9">
</HEAD>
 <center>
<H2>Program Base Library Functions</H2>
</center>

<H2>int <A HREF="#DOC.DOCU">pblKEYFILE_TestFrame</A></H2><H2>( int argc,  char*  argv[] )</H2><BLOCKQUOTE> test frame for the key file library</BLOCKQUOTE>

<A NAME="DOC.DOCU"></A>
<HR>
<H2>Documentation</H2>
<BLOCKQUOTE>
test frame for the key file library

<P>This test frame calls the key file library,
it is an interactive test frame capable of regression tests.

<P><B>Interactive mode:</B>
<UL>
Call the program pblkftst from a UNIX or DOS shell.
<BR>
The following commands to test the PBL Key File Library are supplied:
<UL>
<PRE>
 q       FOR QUIT
 create  <filename>
 open    <filename> <update>
 close | flush | delete
 insert  <key> <data>
 ninsert <n> <key> <data>
 find    <key> < LT | LE | FI | EQ | LA | GE | GT >
 update  <data>
 ndelete <n>
 first | last | next | prev | this | read
 list    <n>
 </PRE>
</UL>
</UL>
<B>Interactive mode example:</B>
<UL>
The following short examples demonstrates how to use the interactive
test frame. Lines starting with a # are printed by the program
lines starting with other characters are user input.
<UL>
<PRE>
pblkftst

<P>##command: 
create /tmp/keytest
# create filename 
# pblKfCreate( /tmp/keytest )
# ok!

<P>##command: 
insert testkey testdata
# insert key, data
# pblKfInsert( 1, testkey, 8, testdata, 9 )
# rc 0, pbl_errno 0, errno 0

<P>##command: 
first
# pblKfFirst( 1 )
# datalen 9, key testkey, keylen 8

<P>##command: 
close
# pblKfClose( 1 )
# rc 0, pbl_errno 0, errno 0

<P>##command: 
quit
   </PRE>
</UL>
</UL>

<P><B>Regression mode:</B>
<UL>
Put a sequence of test commands into a test batch file.
<P>
Example:
<UL>
Open a new file KEY0001.TST and add the following lines
<PRE>
create /tmp/keytest2
insert testkey testdata
first
close
quit
</PRE>
</UL>
Then run pblkftst KEY0001.TST

<P>The program creates a log file called <B>pblkftst.log</B> when run.
This log file can be used as regression input file for further
tests.
<UL>
<PRE>
##command:
create # create filename
/tmp/key0001
# pblKfCreate( /tmp/key0001 )
# ok!

<P>##command:
insert # insert key, data
testkey testdata
# pblKfInsert( 1, testkey, 8, testdata, 9 )
# rc 0, pbl_errno 0, errno 0

<P>##command:
first
# pblKfFirst( 1 )
# datalen 9, key testkey, keylen 8

<P>##command:
close
# pblKfClose( 1 )
# rc 0, pbl_errno 0, errno 0

<P>##command:
quit
</PRE>
</UL>
Keep the contents of this file and diff it with the outout of
the KEY0001.TST testcase you created whenever you change
the code of the library. 

<P>See <!1><A HREF="pblISAMFILE_TestFrame.html">pblISAMFILE_TestFrame</A> for an example of regression
tests with a test frame. The regression test cases given with
<!1><A HREF="pblISAMFILE_TestFrame.html">pblISAMFILE_TestFrame</A> of course also test the PBL Key File
library.
</UL></BLOCKQUOTE>
<DL><DT><DD></DL><P><P><I><A HREF="index.html">Alphabetic index</A></I></P><HR>
<BR>
This page was generated with the help of <A HREF="http://docpp.sourceforge.net">DOC++</A>.
</BODY>
</HTML>
